package com.csd.serviceImpl;

import java.util.List;

import com.csd.dao.ResearchFieldDAO;
import com.csd.exception.GetException;
import com.csd.pojo.ResearchField;
import com.csd.service.IResearchFieldService;
/**
 * 
 * Service：研究领域
 * @author csd
 * @version 1.0
 * 
 * <br> 修订时间：2009-12-17
 * <br> 修改原因：创建文件
 * <br> 修改人：刘世彬
 * 
 * <br> 
 * 
 */
public class ResearchFieldService implements IResearchFieldService {
	private ResearchFieldDAO researchFieldDAO;

	public ResearchFieldDAO getResearchFieldDAO() {
		return researchFieldDAO;
	}

	public void setResearchFieldDAO(ResearchFieldDAO researchFieldDAO) {
		this.researchFieldDAO = researchFieldDAO;
	}
	/**
	 * 根据ID查询研究领域
	 * @param projectID
	 * @return Score
	 */
	public ResearchField getResearchField(Integer ID) {
		ResearchField researchField = null;

		try {
			researchField = researchFieldDAO.findById(ID);

		} catch (RuntimeException re) {
					throw new GetException(re, "");
				}

		return researchField;
	}
	/**
	 * 查询所有研究领域
	 * @param projectID
	 * @return Score
	 */
	public List<ResearchField> listAllResearchField() {
		List<ResearchField> list = null;

		try {
			list = researchFieldDAO.findAll();

		} catch (RuntimeException re) {
					throw new GetException(re, "列出所有研究领域异常");
				}

		return list;
	}
}
